import 'package:flutter/material.dart';
import 'package:power_house/pages/home/info/index.dart';
import 'package:power_house/pages/home/tab_index/Index_navigator.dart';
import 'package:power_house/pages/home/tab_index/index_recommoned.dart';
import 'package:power_house/widgets/common_swiper.dart';

import '../../../widgets/search_bar/index.dart';

class TabIndex extends StatelessWidget {
  const TabIndex({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: SearchBar(
          showLocation: true,
          showMap: true,
          onSearch: (){
            Navigator.of(context).pushNamed('search');
          },
        ),
        backgroundColor: Colors.white,
      ),
      body: ListView(
        children: const <Widget>[
          CommonSwiper(), //轮播图
          IndexNavigator(), //水平导航栏
          IndexReCommand(), //房屋推荐
          Info(), //资讯列表
        ],
      ),
    );
  }
}
